Skip to content

feat(agent): auto-assign PR opener as GitHub assignee (#3182)#3209

Merged
JSONbored merged 2 commits into
mainfrom
feat/auto-assign-pr-opener
Jul 4, 2026
Merged

feat(agent): auto-assign PR opener as GitHub assignee (#3182)#3209
JSONbored merged 2 commits into
mainfrom
feat/auto-assign-pr-opener

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Adds assign as a new agent-layer action class (alongside merge/close/label/review_state_label/update_branch) that best-effort sets a PR's opening contributor as its GitHub assignee, gated by its own per-repo autonomy.assign dial (default observe/off).
  • No new DB migration: autonomy is already a single JSON column (AutonomyPolicy), so a new action class is just a new literal in the shared AGENT_ACTION_CLASSES array — .gittensory.yml parsing, the dashboard dial, and the approval queue all pick it up for free.
  • GitHub silently drops an assignee who lacks push/triage access to the repo instead of erroring (the common case for an external contributor) — the new ensurePullRequestAssignee (src/github/assignees.ts) detects this from the live response and the executor falls back to a per-login contributor:<login> label instead of a comment, so a repeated sweep never spams (the label GET is naturally idempotent).
  • Closes feat(agent): auto-assign PR opener as GitHub assignee (config + wiring) #3182.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Ran targeted validation instead of the full local gate: typecheck, git diff --check, ui:openapi:check (regenerated + verified), and the specific affected suites (test/unit/agent-actions.test.ts, test/unit/agent-action-executor.test.ts, test/unit/github-assignees.test.ts, test/unit/autonomy.test.ts, test/unit/openapi.test.ts, test/unit/ci-openapi-settings-parity.test.ts, test/unit/selfhost-config-examples.test.ts) plus npm run test:changed (224 files / 5756 tests, all green — this touches src/queue/processors.ts so it covers test/unit/queue.test.ts too). No UI/MCP/workers files touched by this diff, so ui:*/test:workers/build:mcp/test:mcp-pack are out of scope. CI runs the full gate on push.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/CORS/session surface touched; new GitHub API call is covered by fetch-stub tests including the silent-drop path.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (autonomy enum regenerated via npm run ui:openapi.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section below... (N/A — backend-only change, no visible UI.)
  • Public docs/changelogs are updated where needed... (N/A — no changelog edit per house rule.)

UI Evidence

N/A — backend-only change, no visible UI.

Notes

Adds `assign` as a new agent-layer action class alongside merge/close/
label/review_state_label, gated by its own per-repo autonomy dial
(default observe/off, config-as-code via .gittensory.yml autonomy.assign,
no DB migration needed since autonomy is a single JSON column).

GitHub silently drops an assignee lacking push/triage access instead of
erroring, so the executor detects that case and falls back to a
per-login `contributor:<login>` label instead of spamming a comment
every sweep.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui f6c9017 Commit Preview URL

Branch Preview URL
Jul 04 2026, 08:21 PM

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 Gittensory is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.75%. Comparing base (6927858) to head (e2e0455).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3209   +/-   ##
=======================================
  Coverage   94.74%   94.75%           
=======================================
  Files         270      271    +1     
  Lines       29778    29803   +25     
  Branches    10861    10870    +9     
=======================================
+ Hits        28214    28239   +25     
  Misses        918      918           
  Partials      646      646           
Files with missing lines Coverage Δ
src/github/assignees.ts 100.00% <100.00%> (ø)
src/openapi/schemas.ts 100.00% <ø> (ø)
src/queue/processors.ts 92.86% <ø> (ø)
src/services/agent-action-executor.ts 96.63% <100.00%> (+0.08%) ⬆️
src/settings/agent-actions.ts 95.93% <100.00%> (+0.04%) ⬆️
src/settings/autonomy.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 4, 2026
…h assignees fallback

GitHub logins run up to 39 chars and label names cap at 50, so the
"contributor:" prefix (12 chars) could push a valid max-length login
past the limit and fail the fallback for exactly the contributors it
exists to cover. Shortened to "by:". Also adds the missing test for
ensurePullRequestAssignee's `?? []` fallback when a GitHub response
omits the assignees field entirely, closing the codecov/patch gap.
@JSONbored
JSONbored merged commit a6d3082 into main Jul 4, 2026
9 checks passed
@JSONbored
JSONbored deleted the feat/auto-assign-pr-opener branch July 4, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

feat(agent): auto-assign PR opener as GitHub assignee (config + wiring)

1 participant